/**
 * Created by ljunb on 16/5/25.
 */
import React, {PureComponent} from 'react';
import {
    Navigator,
    View,
    Text,
    Platform
} from 'react-native';
import TabBarView from '../containers/TabBarView'
import Splash from '../pages/Splash'
// import {observer} from 'mobx-react/native'
//
// @observer
export default class App extends PureComponent {

    _configureScene = (route, routeStack) => Navigator.SceneConfigs.HorizontalSwipeJump;

    _renderScene = (route, navigator) => {
        let Component = route.component;
        return <Component navigator={navigator}{...route.passProps}/>
    };

    render() {
        const initialPage = Platform.OS === 'ios' ? TabBarView : Splash;
        const initialPageName = Platform.OS === 'ios' ? 'TabBarView' : 'Splash';

        return (
            <View style={{flex: 1}}>
                <Navigator
                    initialRoute={{name: initialPageName, component: initialPage}}
                    configureScene={this._configureScene}
                    renderScene={this._renderScene}
                />
            </View>
        )
    }
}